package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;


import java.io.Serial;
import java.io.Serializable;

/**
 * 林地指标平台_合同模板字段选项表 实体类。
 *
 * @author 11987
 * @since 2025-05-31
 */
@Table(value = "LINDI_CONTRACT_TEMPLATE_FIELD_OPTION", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiContractTemplateFieldOption extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 选项ID
     */
    private Long contractTemplateFieldOptionId;

    /**
     * 合同模板配置字段ID
     */
    private Long contractTemplateFieldId;

    /**
     * 选项标签
     */
    private String optionLabel;

    /**
     * 选项值
     */
    private String optionValue;

    /**
     * 排序序号
     */
    private Integer sortOrder;

    public LindiContractTemplateFieldOption() {
    }

    public LindiContractTemplateFieldOption(Long contractTemplateFieldOptionId, Long contractTemplateFieldId, String optionLabel, String optionValue, Integer sortOrder) {
        this.contractTemplateFieldOptionId = contractTemplateFieldOptionId;
        this.contractTemplateFieldId = contractTemplateFieldId;
        this.optionLabel = optionLabel;
        this.optionValue = optionValue;
        this.sortOrder = sortOrder;
    }

    public Long getContractTemplateFieldOptionId() {
        return contractTemplateFieldOptionId;
    }

    public void setContractTemplateFieldOptionId(Long contractTemplateFieldOptionId) {
        this.contractTemplateFieldOptionId = contractTemplateFieldOptionId;
    }

    public Long getContractTemplateFieldId() {
        return contractTemplateFieldId;
    }

    public void setContractTemplateFieldId(Long contractTemplateFieldId) {
        this.contractTemplateFieldId = contractTemplateFieldId;
    }

    public String getOptionLabel() {
        return optionLabel;
    }

    public void setOptionLabel(String optionLabel) {
        this.optionLabel = optionLabel;
    }

    public String getOptionValue() {
        return optionValue;
    }

    public void setOptionValue(String optionValue) {
        this.optionValue = optionValue;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public static LindiContractTemplateFieldOptionBuilder builder() {
        return new LindiContractTemplateFieldOptionBuilder();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiContractTemplateFieldOption that = (LindiContractTemplateFieldOption) o;
        return java.util.Objects.equals(contractTemplateFieldOptionId, that.contractTemplateFieldOptionId) &&
               java.util.Objects.equals(contractTemplateFieldId, that.contractTemplateFieldId) &&
               java.util.Objects.equals(optionLabel, that.optionLabel) &&
               java.util.Objects.equals(optionValue, that.optionValue) &&
               java.util.Objects.equals(sortOrder, that.sortOrder);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), contractTemplateFieldOptionId, contractTemplateFieldId, optionLabel, optionValue, sortOrder);
    }

    @Override
    public String toString() {
        return "LindiContractTemplateFieldOption{" +
                "contractTemplateFieldOptionId=" + contractTemplateFieldOptionId +
                ", contractTemplateFieldId=" + contractTemplateFieldId +
                ", optionLabel='" + optionLabel + '\'' +
                ", optionValue='" + optionValue + '\'' +
                ", sortOrder=" + sortOrder +
                '}';
    }

    public static class LindiContractTemplateFieldOptionBuilder {
        private Long contractTemplateFieldOptionId;
        private Long contractTemplateFieldId;
        private String optionLabel;
        private String optionValue;
        private Integer sortOrder;

        public LindiContractTemplateFieldOptionBuilder contractTemplateFieldOptionId(Long contractTemplateFieldOptionId) {
            this.contractTemplateFieldOptionId = contractTemplateFieldOptionId;
            return this;
        }

        public LindiContractTemplateFieldOptionBuilder contractTemplateFieldId(Long contractTemplateFieldId) {
            this.contractTemplateFieldId = contractTemplateFieldId;
            return this;
        }

        public LindiContractTemplateFieldOptionBuilder optionLabel(String optionLabel) {
            this.optionLabel = optionLabel;
            return this;
        }

        public LindiContractTemplateFieldOptionBuilder optionValue(String optionValue) {
            this.optionValue = optionValue;
            return this;
        }

        public LindiContractTemplateFieldOptionBuilder sortOrder(Integer sortOrder) {
            this.sortOrder = sortOrder;
            return this;
        }

        public LindiContractTemplateFieldOption build() {
            return new LindiContractTemplateFieldOption(contractTemplateFieldOptionId, contractTemplateFieldId, optionLabel, optionValue, sortOrder);
        }
    }

}
